﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Century.Model.CMS
{
  
    public class SitePage 
    {
        [Key]
        public int Id { get; set; }

        public int SiteId { get; set; }
        
        //[Required(ErrorMessage = "*")]
        public int? PageLayoutId { get; set; }

        [RegularExpression("[a-zA-Z0-9_-]{2,40}", ErrorMessage = "*")]
        [Remote("CheckName", "PageManagement", "Admin", AdditionalFields = "Id")]
        [Required(ErrorMessage = "*")]
        public string Name { get; set; }

        [RegularExpression("[a-zA-Z0-9_-]{2,40}", ErrorMessage = "*")]
        [Remote("CheckLocalName", "PageManagement", "Admin", AdditionalFields = "Id")]
        [Required(ErrorMessage = "*")]
        public string LocalName { get; set; }

        public bool IsHomePage { get; set; }
        [Required(ErrorMessage = "*")]
        public string Title { get; set; }
        public string Keywords { get; set; }
        public string Description { get; set; }
        public int? ParentId { get; set; }
        public string Url { get; set; }
        public string Roles { get; set; }
        public int NodeOrder { get; set; }
        public bool ShowInMenu { get; set; }
        public bool ShowInRightMenu { get; set; }
        public string MenuDescription { get; set; }
        public string ImagePath { get; set; }
        public bool IsPublished { get; set; }
        public int DraftSourcePageId { get; set; }
        public string MenuImagePath { get; set; }

        #region [ Navigation(s) ]

        public PageLayout PageLayout { get; set; }
        public Site Site { get; set; }
        public ICollection<ContentHolderPart> ContentHolderParts { get; set; }
        public ICollection<SitePageParameter> SitePageParameters { get; set; }

        #endregion
    }
}
